unit Unit3;

interface

uses
  Winapi.Windows, Winapi.Messages, System.SysUtils, System.Variants, System.Classes, Vcl.Graphics,
  Vcl.Controls, Vcl.Forms, Vcl.Dialogs, Vcl.StdCtrls, Vcl.OleCtrls, SHDocVw;

type
  TForm3 = class(TForm)
    Button1: TButton;
    WebBrowser3: TWebBrowser;
    Edit1: TEdit;
    procedure Button1Click(Sender: TObject);
    procedure WebBrowser3DocumentComplete(ASender: TObject;
      const pDisp: IDispatch; const URL: OleVariant);
    procedure Edit1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Form3: TForm3;

implementation

{$R *.dfm}

procedure TForm3.Button1Click(Sender: TObject);
begin
webbrowser3.Navigate('http://www.okazii.ro/cont/creare/');
end;



procedure TForm3.Edit1KeyUp(Sender: TObject; var Key: Word; Shift: TShiftState);
begin
if edit1.Text<>'' then
button1.Enabled:=true
else
button1.Enabled:=false;
end;

procedure TForm3.WebBrowser3DocumentComplete(ASender: TObject;
  const pDisp: IDispatch; const URL: OleVariant);
begin
if webbrowser3.LocationURL  = 'http://www.okazii.ro/cont/creare/' then
if (ASender as TWebBrowser).OleObject.document.all.item('answer_pas',0).value='' then
begin
(ASender as TWebBrowser).OleObject.document.all.item('prenume',0).value:='Marian';
(ASender as TWebBrowser).OleObject.document.all.item('nume',0).value:='Stan';
(ASender as TWebBrowser).OleObject.document.all.item('email',0).value:=edit1.Text+'@yahoo.com';
(ASender as TWebBrowser).OleObject.document.all.item('remail',0).value:=edit1.Text+'@yahoo.com';
(ASender as TWebBrowser).OleObject.document.all.item('username',0).value:=edit1.Text;
(ASender as TWebBrowser).OleObject.document.all.item('password',0).value:='1234asdf';
(ASender as TWebBrowser).OleObject.document.all.item('repassword',0).value:='1234asdf';
(ASender as TWebBrowser).OleObject.document.all.item('question_pas',0).selectedIndex:=1;
(ASender as TWebBrowser).OleObject.document.all.item('answer_pas',0).value:='labulaimalai';

(ASender as TWebBrowser).OleObject.document.all.item('datepersonale_form',0).submit;

end;
end;

end.
